import Vue from 'vue';
import Router from 'vue-router';
import index from '@/components/index/index.vue';
import take from '@/components/take/take.vue';
import Shop from '@/components/shop/shop.vue';

Vue.use(Router);

let router = new Router({
  // 去除#
  mode: 'history',
  routes: [{
      path: '/',
      component: index
    },
    {
      path: '/index',
      component: index
    },
    {
      path: '/take',
      component: take
    },
    {
      path: '/shop',
      component: Shop
    }
  ]
});
const routerPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error => error);
};
export default router;
